#pragma once
#include "CFG.h"
#include "Assert.h"

using namespace std;

//A CFG corresponds to a procedure
CFG::CFG(Type::Index::Proc proc){
	mProcIndex = proc;
}
CFG::~CFG(void){
	mProcIndex = NULL;		
}
void CFG::setRoot(CFGNode* root){
	myRoot = root;
}
void CFG::setEnd(CFGNode* end){
	myEnd = end;
}
Type::Index::Proc CFG::getProcIndexCFG(){
	return mProcIndex;
}
CFGNode* CFG::getRoot(){
	assert (myRoot);
	return myRoot;
}
CFGNode* CFG::getEnd(){
	assert (myEnd);
	return myEnd;
}
bool linkCFGNodes(CFGNode* pred, CFGNode* succ){
	assert(pred);
	assert(succ);
	pred->addSuccessor(succ);
	succ->addPredecessor(pred);
	return true;
}